<!-- vue的生命周期:一般是使用挂载函数来操作数据-->
<script setup lang="ts">
import { onBeforeMount, onBeforeUpdate, onMounted, onUpdated, ref } from 'vue'
//挂载
onMounted(() => {
  console.log('mounted')
})
onBeforeMount(() => {
  console.log('beforeMount')
})

//修改
onUpdated(() => {
  console.log('updated')
})
onBeforeUpdate(() => {
  console.log('beforeUpdate')
})
const num = ref(0)
</script>

<template>
  <h2 @click="num++">我是数据:{{ num }}</h2>
</template>

<style></style>
